package club.easin.sq.ctl;

import club.easin.common.DatagridRequestDto;
import club.easin.sq.bl.Noticebl;
import club.easin.sq.dao.SqNoticeMapper;
import club.easin.sq.dto.SqNotice;
import club.easin.utils.ReturnDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("notice")
public class NoticeCtl {

    @Autowired
    private Noticebl noticebl;

    @RequestMapping("addNotice")
    @ResponseBody
    public ReturnDto addNotice(@RequestBody SqNotice sqNotice){
        return noticebl.addNotice(sqNotice);
    }

    @RequestMapping("delNotice")
    @ResponseBody
    public ReturnDto delNotice(String noticeid){
        return noticebl.delNotice(noticeid);
    }

    @RequestMapping("editNotice")
    @ResponseBody
    public ReturnDto editNotice(@RequestBody SqNotice sqNotice){
        return noticebl.editNotice(sqNotice);
    }

    @RequestMapping("getNoticeGrild")
    @ResponseBody
    public ReturnDto getNoticeGrild(@RequestBody DatagridRequestDto dto){
        return noticebl.getNoticeGrild(dto);
    }
}
